package com.ruoyi.source.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.SourcePushResultInfoMapper;
import com.ruoyi.db.domain.SourcePushResultInfo;
import com.ruoyi.source.service.ISourcePushResultInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 线索推送结果Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-22
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class SourcePushResultInfoServiceImpl implements ISourcePushResultInfoService 
{
    @Autowired
    private SourcePushResultInfoMapper sourcePushResultInfoMapper;

    /**
     * 查询线索推送结果
     * 
     * @param id 线索推送结果主键
     * @return 线索推送结果
     */
    @Override
    public SourcePushResultInfo selectSourcePushResultInfoById(Long id)
    {
        return sourcePushResultInfoMapper.selectSourcePushResultInfoById(id);
    }

    /**
     * 查询线索推送结果列表
     * 
     * @param sourcePushResultInfo 线索推送结果
     * @return 线索推送结果
     */
    @Override
    public List<SourcePushResultInfo> selectSourcePushResultInfoList(SourcePushResultInfo sourcePushResultInfo)
    {
        return sourcePushResultInfoMapper.selectSourcePushResultInfoList(sourcePushResultInfo);
    }

    /**
     * 查询线索推送结果列表
     *
     * @param sourcePushResultInfo 线索推送结果
     * @return 线索推送结果
     */
    @Override
    public List<Map<String, Object>> selectSourcePushResultInfoListMap(SourcePushResultInfo sourcePushResultInfo)
    {
        return sourcePushResultInfoMapper.selectSourcePushResultInfoListMap(sourcePushResultInfo);
    }

    /**
     * 新增线索推送结果
     * 
     * @param sourcePushResultInfo 线索推送结果
     * @return 结果
     */
    @Override
    public int insertSourcePushResultInfo(SourcePushResultInfo sourcePushResultInfo)
    {
        sourcePushResultInfo.setCreateTime(DateUtils.getNowDate());
        return sourcePushResultInfoMapper.insertSourcePushResultInfo(sourcePushResultInfo);
    }

    /**
     * 修改线索推送结果
     * 
     * @param sourcePushResultInfo 线索推送结果
     * @return 结果
     */
    @Override
    public int updateSourcePushResultInfo(SourcePushResultInfo sourcePushResultInfo)
    {
        sourcePushResultInfo.setUpdateTime(DateUtils.getNowDate());
        return sourcePushResultInfoMapper.updateSourcePushResultInfo(sourcePushResultInfo);
    }

    /**
     * 批量删除线索推送结果
     * 
     * @param ids 需要删除的线索推送结果主键
     * @return 结果
     */
    @Override
    public int deleteSourcePushResultInfoByIds(String ids)
    {
        return sourcePushResultInfoMapper.deleteSourcePushResultInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除线索推送结果信息
     * 
     * @param id 线索推送结果主键
     * @return 结果
     */
    @Override
    public int deleteSourcePushResultInfoById(Long id)
    {
        return sourcePushResultInfoMapper.deleteSourcePushResultInfoById(id);
    }
}
